﻿using corpus_platform.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace corpus_platform.Data
{
    public static class CustomDependencyProperty
    {
        public static string GetSelectedText(DependencyObject obj)
        {
            return (string)obj.GetValue(SelectedTextProperty);
        }

        public static void SetSelectedText(DependencyObject obj, string value)
        {
            obj.SetValue(SelectedTextProperty, value);
        }

        public static readonly DependencyProperty SelectedTextProperty =
            DependencyProperty.RegisterAttached("SelectedText", typeof(string), typeof(CustomDependencyProperty), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));



        public static int GetSelectedTextPosition(DependencyObject obj)
        {
            return (int)obj.GetValue(SelectedTextPositionProperty);
        }

        public static void SetSelectedTextPosition(DependencyObject obj, int value)
        {
            obj.SetValue(SelectedTextPositionProperty, value);
        }

        // Using a DependencyProperty as the backing store for SelectedTextPosition.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty SelectedTextPositionProperty =
            DependencyProperty.RegisterAttached("SelectedTextPosition", typeof(int), typeof(CustomDependencyProperty), new PropertyMetadata(-1));

    }
}
